<template>
  <draggable class="content" group="content" v-model="content" @change="toChange">
    <div v-for="(item,index) in content" :key="index">
      {{item.title}}
      <baseContainer v-if="item.name == 'base-container'" />
    </div>
  </draggable>
</template>

<script>
import draggable from 'vuedraggable'
import baseContainer from './base-container'

export default {
  name:"tmpContent",
  components:{
    draggable,
    baseContainer
  },
  methods: {
    toChange(e){
      console.log("toChange",e,this.content)
    }
  },
  computed:{
    content:{
      get(){
        return this.$store.state.drawing.content
      },
      set(e){
        return this.$store.commit("drawing/saveContent",e)
      }
    }
  }
}
</script>

<style scoped>
  .content{
    width: 375px;
    height: 667px;
  }
</style>